package com.gz.spring.component;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
public class UserService {
    @Resource
    private UserDao userDao;

    public void m1(){
        userDao.sayHello();
    }

    @PostConstruct
    public void init(){
        System.out.println("UserService的init()方法");
    }
}
